/**
 * 
 */
package com.jjt.kiki.dao;

import java.sql.Connection;
import java.sql.SQLException;

import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;

/**
 * @author jjtEatJava
 *
 */
public abstract class BaseDao{
	private static final String JDBC_URL = "jdbc:mysql://localhost:3306/db_crawler?serverTimezone=UTC&characterEncoding=utf8&useSSL=true";
	private static final String JDBC_USERNAME="root";
	private static final String JDBC_PASSWORD="";
	private static  HikariDataSource DATA_SOURCE = null;
	{
		HikariConfig config = new HikariConfig();
		config.setJdbcUrl(JDBC_URL);
		config.setUsername(JDBC_USERNAME);
		config.setPassword(JDBC_PASSWORD);
		DATA_SOURCE = new HikariDataSource(config);
	}
	
	protected Connection getConnection() throws SQLException {
		return DATA_SOURCE.getConnection();
	}
}
